<?php

include 'islogin.php';

include '../config.php';



if(isset($_GET['flag']))

{



	if($_GET['flag']=='del')

	{

		$sql = "update en_problem set flag =0 where id=".$_GET['id'];

		mysql_query($sql);

	}

}

?>

<script src="../js/jquery-1.7.1.js"></script>

<link href="images/skin.css" rel="stylesheet" type="text/css" />

<link href="css/right.css" rel="stylesheet" type="text/css"/>

<script>

function mouseoverTD(obj)

{

	   $(obj).css("background","#aaa");

}

function mouseoutTD(obj)

{

	  $(obj).css("background","");

}



function del(id,obj)

{

	  if(confirm("是否要删除此条公告信息？"))

	  {

		  var url = "problem_list.php?flag=del&id="+id;

		  

		  window.location.href=url;

	  }

	  

}

</script>





<div style="border:0px solid red;"> 



    	<div id="top"><div>服务公告</div></div>

    	

	    <div id="middle">

	    	<!-- 类型列表 -->

	      <div class="layout">

		       <div class="title">公告列表</div>

		       <div class="content">

		       

		       	 <table  cellspacing="0" cellpadding="0">  

			   				<tr >

				   		   		<td class="title_some_td" style="width:300px; text-align:center;">公告标题</td>

				   		   		<td class="title_some_td" style="width:100px; text-align:center;">公告日期</td>

				   		   		<td class="title_some_td" style="width:100px; text-align:center;">阅读数</td>

				   		   		<td class="title_some_td" style="width:100px; text-align:center;">操作</td>

				   		   </tr>

				   		   <?php 

				   		   		$sql = "select id,path,title,remark,dates,_reads from en_problem where flag =1";

				   		   		$result = mysql_query($sql);

				   		   		

				   		   		while($row = mysql_fetch_array($result))

				   		   		{

				   		   	?>

				   		   		<tr style='cursor:pointer;'  onmouseover='mouseoverTD(this)' onmouseout='mouseoutTD(this)'>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['title'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['dates'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['_reads'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;">

				   		   			<a style='text-decoration:underline;' href='javascript:return false;' onclick="del('<?php echo $row['id']?>',this)">删除</a>

				   		   			<a style='text-decoration:underline;' href='problem_add.php?flag=update&id=<?php echo $row['id']?>'>修改</a>

				   		   			</td>

				   		   		</tr>

				   		   	

				   		   	<?php

				   		   		}

				   		   ?>

				  </table> 		   

		       </div>

		  </div>

		 </div>

		 <div id="bottom"></div>

</div>		  